﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using MvcText1101.Data;

namespace MvcText1101.Models
{
    //public class MusicStoreDbInitializer : DropCreateDatabaseAlways<MusicStoreDB>
    //{
    //    protected override void Seed(MusicStoreDB context)
    //    {
    //        context.Artists.Add(new Artist { Name = "老王", Description = "Is 小俊" });

    //        context.Genres.Add(new Genre { Name = "程序员" });


    //        base.Seed(context);
    //    }

    //}

    public class MusicStoreDbInitializer : CreateDatabaseIfNotExists<MusicStoreDB>
    {
        protected override void Seed(MusicStoreDB context)
        {
            context.Artists.Add(new Artist { Name = "小俊", Description = "Is xiaojun" });

            context.Genres.Add(new Genre { Name = "爵士" });

            base.Seed(context);
        }
    }
}
